define(['app', 'assets/js/distpicker.min.js'],function(app){return {module: function($scope, $http, eventBusService, httpService, params) {




		//学籍状态
		httpService.post(app.urls.dictionary_selectByRule,{fk_rule:"SJAAAAA10061"},function(data){
			if("0000" === data.code){
				$scope.xjztList = data.data;
			}else{
				alert(data.msg);
			}
		});






		//查询学生
		$scope.findStudent= function(){
			httpService.postpage(app.urls.student_selectReshuffle,{name:$scope.form.name,fk_grade:$scope.form.fk_grade,fk_major:$scope.form.fk_major,fk_class:$scope.form.fk_class,state:$scope.form.state},function(data){
				if("0000" === data.code){
					$scope.studentList = data.data;
					$scope.findGrade();
				}else{
					alert(data.msg);
				}
			});
		}
		$scope.findStudent();


		//查询年级
		$scope.findGrade = function(){
			httpService.post(app.urls.grade_select,{fk_stage:"02030218-1e1c-4dc8-81f5-10e0ceb015a4"},function(data){
				if("0000" === data.code){
					$scope.gradeList = data.data;
				}else{
					alert(data.msg);
				}
			});
		}

		//查询专业
		$scope.findMajor= function(){
			httpService.post(app.urls.major_select,{fk_grade:$scope.form.fk_grade},function(data){
				if("0000" === data.code){
					$scope.majorList = data.data;
				}else{
					alert(data.msg);
				}
			});
		}


		//查询班级
		$scope.findClass= function(){
			httpService.post(app.urls.class_select,{fk_grade:$scope.form.fk_grade,fk_major:$scope.form.fk_major},function(data){
				if("0000" === data.code){
					$scope.classList = data.data;
				}else{
					alert(data.msg);
				}
			});
		}


		//选择
		$scope.choose = function(student){

			eventBusService.publish("modal.page", "modules/content/schoolroll/reshuffle/add?fk_student="+student.id);


		}


		//按钮点击事件-条件查询
		$scope.select = function(){
			$scope.page.current = 1;
			$scope.findStudent();
		}




}}});